package com.accounting.client.remote.enumeration;

import java.util.List;

import corelib.client.CollectionUtil;
import corelib.client.jsonrpc.JSONSerializable;

public class OrderType implements JSONSerializable {
	
	private int    Type;
	private String Name;
	private String CName;
	public OrderType(int type, String name, String cname) {
		Type  = type;
		Name  = name;
		CName = cname;
	}

	public int getType() {
		return Type;
	}

	public void setType(int type) {
		Type = type;
	}

	public String getName() {
		return Name;
	}

	public void setName(String name) {
		Name = name;
	}
	
	
	public String getCName() {
		return CName;
	}

	public void setCName(String cName) {
		CName = cName;
	}

	public static OrderType getType(int type) {
		if (type == 1){
			return DirectOrder;
		}
		else if (type == 0){
			return TransferStock;
		}
		else {
			return Unknow;
		}
	}
	
	public final static OrderType DirectOrder   = new OrderType(1, "Direct Order","订单");
	public final static OrderType TransferStock = new OrderType(0, "Stock Order", "库存订单");
	public final static OrderType Unknow = new OrderType(99, "", "");
	
	public final static List<OrderType> All = CollectionUtil.newArrayList(Unknow, TransferStock, DirectOrder);
	
}
